
(defvar eip-exist-emacs-instance nil
  "Emacs instance exists already?")

(defmacro eip-make-hook-fn (hook &rest body)
  "Add a function to HOOK, with body BODY."
  ;; hooks often not bound. Could change to using mode as argument,
  ;; and checking that is fbound.
  (if (not (boundp hook))
      (message "No such hook `%s'" hook)
    (let ((fn (intern (format "eip-%s-fn" hook))))
      `(progn
	 (defun ,fn ()
	   ,(format "Function added to `%s'." hook)
	   ,@body)
	 (add-hook ',hook ',fn)))))

(provide 'eip_utils)
